<template>
  <div id="welcome">
    管理首页
    <el-divider></el-divider>
    <div class="tabs">
      <el-row :gutter="30">
        <el-col :span="8">
          <div class="tab_item1" @click="$router.push('/send')">
            <div class="left">
              <div class="title">新增博客</div>
              <div class="p">记忆心中所想</div>
            </div>
            <div class="right">
              <i class="iconfont icon-bianji"></i>
            </div>
            <div class="go">前 往 <i class="el-icon-right"></i></div>
          </div>
        </el-col>
        <el-col :span="8">
          <div class="tab_item2" @click="$router.push('/user')">
            <div class="left">
              <div class="title">{{ res.usernumber }}</div>
              <div class="p">用户数量</div>
            </div>
            <div class="right">
              <i class="el-icon-user"></i>
            </div>
            <div class="go">前 往 <i class="el-icon-right"></i></div>
          </div>
        </el-col>
        <el-col :span="8">
          <div class="tab_item3" @click="$router.push('/article')">
            <div class="left">
              <div class="title">{{ res.articlenumber }}</div>
              <div class="p">总文章数</div>
            </div>
            <div class="right">
              <i class="iconfont icon-wenben"></i>
            </div>
            <div class="go">前 往 <i class="el-icon-right"></i></div>
          </div>
        </el-col>
        <el-col :span="8">
          <div class="tab_item4" @click="$router.push('/comment')">
            <div class="left">
              <div class="title">{{ res.commentnumber }}</div>
              <div class="p">收到评论</div>
            </div>
            <div class="right">
              <i class="iconfont icon-comment"></i>
            </div>
            <div class="go">前 往 <i class="el-icon-right"></i></div>
          </div>
        </el-col>
        <el-col :span="8">
          <div class="tab_item5" @click="$router.push('/classification')">
            <div class="left">
              <div class="title">{{ res.classificationnumber }}</div>
              <div class="p">分类数量</div>
            </div>
            <div class="right">
              <i class="iconfont icon-fenlei"></i>
            </div>
            <div class="go">前 往 <i class="el-icon-right"></i></div>
          </div>
        </el-col>
        <el-col :span="8">
          <div class="tab_item6" @click="$router.push('/nav')">
            <div class="left">
              <div class="title">{{ res.navigationnumber }}</div>
              <div class="p">导航数量</div>
            </div>
            <div class="right">
              <i class="iconfont icon-daohang"></i>
            </div>
            <div class="go">前 往 <i class="el-icon-right"></i></div>
          </div>
        </el-col>
      </el-row>
    </div>

  </div>
</template>

<script>
import { getDataInfo } from '@/api/index'

export default {
  name: 'welcome',
  data() {
    return {
      res: {}
    }
  },
  mounted() {
    this.getDataInfo()
  },
  methods: {
    getDataInfo() {
      getDataInfo().then((res) => {
        this.res = res.data.res
      })
    }
  }
}
</script>

<style lang="less" src="./index.less" scoped></style>